<template>
  <div class="nation">
    <el-checkbox-group v-model="model.nationList" @change="handlerCheckBox">
      <el-checkbox label="1">汉族</el-checkbox>
      <el-checkbox label="2">少数民族</el-checkbox>
    </el-checkbox-group>
    <!-- <el-input v-model="model.nationValue" style="width:120px" /> -->
    <el-select
      v-model="model.nationValue"
      clearable
      filterable
      placeholder="请选择"
    >
      <el-option
        v-for="item in options"
        :key="item.value"
        :label="item.label"
        :value="item.value"
      >
      </el-option>
    </el-select>
  </div>
</template>

<script>
import { nationType } from "@/simdata/healthData.js"
export default {
  props: {
    model: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {
      options: nationType
    }
  },
  methods: {
    // 点击切换
    handlerCheckBox(value) {
      if (this.model.nationList.length > 1) {
        this.model.nationList.splice(0, 1)
      }
      // console.log(this.model.nationList)
    }
  }
}
</script>
<style lang="scss" scoped>
.nation {
  display: flex;
  .el-select {
    margin-left: 15px;
  }
}
</style>
